import { rcaNumberFormat } from './common.js'
import { commonTableOption } from './common.js'
export const tableOption = {
  ...commonTableOption,
  selection: true,
  menu: true,
  addBtn: true,
  delBtn: false,
  dialogFullscreen: false,
  column: [
    {
      type: 'input',
      label: '主报表名称',
      prop: 'mainReportName',
      rules: [{
        required: true,
        message: '请输入主报表名称',
        trigger: 'blur'
      }],
    }, {
      type: 'input',
      label: '对比主报表名称',
      prop: 'comparisonMainReportName',
      rules: [{
        required: true,
        message: '请输入对比主报表名称',
        trigger: 'blur'
      }],
    }, {
      type: 'select',
      label: '差异类型',
      prop: 'differenceType',
      search: true,
      searchLabelWidth: 100,
      dicUrl: '/rca/swckreportreview/diffType',
      props: {
        label: 'name',
        value: 'code'
      },
      rules: [{
        required: true,
        message: '请选择差异类型',
        trigger: 'blur'
      }],

    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '差异金额',
      prop: 'differenceAmount',
      searchslot: true,
      search: true,
      searchLabelWidth: 100,
      rules: [{
        required: true,
        message: '请输入差异金额',
        trigger: 'blur'
      }],
    }, {
      type: 'date',
      label: '主报表筛选结束时间',
      prop: 'recordDifferenceTime',
      searchSpan: 12,
      searchRange: true,
      search: true,
      searchLabelWidth: 180,
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      rules: [{
        required: true,
        message: '请选择主报表筛选结束时间',
        trigger: 'blur'
      }],
    }, {
      type: 'date',
      label: '记录差异时间',
      prop: 'mainReportCreateTime',
      searchSpan: 12,
      searchRange: true,
      search: true,
      searchLabelWidth: 100,
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      rules: [{
        required: true,
        message: '请选择记录差异时间',
        trigger: 'blur'
      }],
    }, {
      type: 'input',
      label: '备注',
      prop: 'remark',
      rules: [{
        required: true,
        message: '请输入备注',
        trigger: 'blur'
      }],
    }
  ]
}
